<% @query = {} unless @query %>
<%= form_tag url_for(:controller => 'tags', :action => 'search'), :class => 'search', :method => :get do %>
<fieldset>
  <legend>Search tags</legend>
  <p>
    <%= text_field_tag "query[name]", @query[:name], :id => 'tag_search'  %>
    <%= link_to_help "tag-search-text-help" %>
    <%= select_tag "query[type]", options_for_select(["", "Fandom", "Character", "Relationship", "Freeform"], @query[:type]) %>
    <label for="canonical">canonical?</label>&nbsp;<%= check_box_tag "query[canonical]", true, @query[:canonical], :id => 'canonical' %>
    <%= link_to_help "tag-search-type-help" %>
  </p>
  <span class="submit"><%= submit_tag t('.tags.search', :default => 'Search tags'), :name => nil %></span>
</fieldset>
<% end %>
